//
//  ViewController.swift
//  YDemoDelegate
//
//  Created by bruce yao on 2019/7/17.
//  Copyright © 2019 bruce yao. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    // MARK: - Navigation
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier != nil && (segue.identifier?.elementsEqual("NextVC"))! {
            let nextVC = segue.destination as! NextViewController
            nextVC.delegate = self
        }
    }
}
extension ViewController: NextVCDelegate {
    func nextVCTextFieldValue(value: String?) {
        print(value)
    }
}

